package net.hserver.gateway.controller;


import cn.hserver.plugin.web.annotation.WebSocket;
import cn.hserver.plugin.web.handlers.Ws;
import cn.hserver.plugin.web.interfaces.WebSocketHandler;

@WebSocket("/ws")
public class TestWebSocketController implements WebSocketHandler {

    @Override
    public void onConnect(Ws ws) {
        ws.send("666");
        System.out.println("连接："+ws.getUid());
    }

    @Override
    public void onMessage(Ws ws) {
        System.out.println("消息:"+ws.getMessage());
    }

    @Override
    public void disConnect(Ws ws) {
        System.out.println("断开："+ws.getUid());
    }
}
